package com.spider.demo;

public class SilverCard extends  Card{
    public SilverCard(String number, String name, String phone, double balance) {
        super(number, name, phone, balance);
    }

    @Override
    public void payMoney(double money) {
        System.out.println("您当前消费："+ money);
        System.out.println("优惠后的价格为："+ money * 0.9);
        if (money * 0.9>=getBalance()){
            System.out.println("您的余额不足，请充值！🙂");
            return;//退出方法
        }
        //更新后的账户余额
        setBalance(getBalance()-money*0.9);
    }
}
